<script setup>
import { CloseBold, SemiSelect } from '@element-plus/icons-vue'

// 最小化
const set_min = async () => {
  window.electronAPI.sendMessage({
    type: 'miniWindow'
  })
}

// 关闭应用
const close_app = async () => {
  window.electronAPI.sendMessage({
    type: 'closeWindow'
  })
}
</script>

<template>
  <div
    class="h-[38px] header-menu bg-[#20222e] bg-opacity-[90%] flex items-center justify-between px-2"
  >
    <div class="text-[15px] opacity-70 font-bold">云网吧菜单</div>
    <div class="flex-1 h-[40px]" :style="{ '-webkit-app-region': 'drag' }"></div>
    <div class="flex items-center space-x-4">
      <div class="opacity-[60%] cursor-pointer p-1" @click="set_min">
        <el-icon size="14">
          <SemiSelect></SemiSelect>
        </el-icon>
      </div>
      <div class="opacity-[60%] cursor-pointer p-1" @click="close_app">
        <el-icon size="15">
          <CloseBold></CloseBold>
        </el-icon>
      </div>
    </div>
  </div>
</template>

<style scoped>
.header-menu {
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
}
</style>
